//
//  GameVC.h
//  Mockup
//
//  Created by Bernardo Quibiana on 2/20/10.
//  Copyright 2010 Mac-Easy@USC. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "Board.h"
#import "Configuration.h"
#import "HighScoresVC.h"
#import "HelpVC.h"
#import "OptionsVC.h"
#import "AboutVC.h"
#import "Utils.h"


#define TIMERVALUE 150
#define READYVALUE 5

@interface GameVC : UIViewController <UIActionSheetDelegate, UIAlertViewDelegate, UITextFieldDelegate> {
	//Back-end board properties
	Board * board;
	difficulty_t difficulty;
	gamestate_t gameState;
	CGPoint initialTouchPos;
	NSInteger score;
	BOOL emptyBoard;
	
	//Timer properties
	BOOL timerIsCountingDown;
	NSTimer *myTimer;
	NSTimer *readyTimer;
	IBOutlet UIImageView *readyImage_1;
	IBOutlet UIImageView *readyImage_2;
	IBOutlet UIImageView *readyImage_3;
	IBOutlet UILabel *myCounterLabel;
	
	//Menu and text alert properties
	IBOutlet UITextField *myTextField;
	NSString *acceptable;
	NSString *userName;
	
	IBOutlet UILabel *scoreLabel;
}

/** PROPERTIES **/
//Back-end board properties
@property (nonatomic, retain) Board * board;
@property (nonatomic) difficulty_t difficulty;
@property (nonatomic) gamestate_t gameState;
@property (nonatomic) CGPoint initialTouchPos;
@property (nonatomic) NSInteger score;

//Timer properties
@property(nonatomic, retain) NSTimer *myTimer;
@property(nonatomic, retain) NSTimer *readyTimer;
@property (nonatomic, retain) IBOutlet UILabel *myCounterLabel;

//Menu and text alert properties
@property(nonatomic, retain) IBOutlet UITextField *myTextField;
@property(nonatomic, retain)  NSString *acceptable;
@property(nonatomic, retain)  NSString *userName;
//@property(nonatomic, retain)  char *source;

@property (nonatomic, retain) IBOutlet UILabel *scoreLabel;

/** METHODS **/
//Back-end board methods
-(id) initWithDifficulty: (difficulty_t) _difficulty;
-(id) initWithContentOfFile:(NSString *) filename;
-(void) readyForInput:(NSTimer *) theTimer;
-(void) matchBoard:(NSTimer *) theTimer;

//Timer methods

//-(void)changeCountPicture;
-(void)setUpCountTimer:(NSTimer *)theTimer;
-(void)setUpReadyTimer:(NSTimer *)theTimer;
-(void)stopTimer:(NSTimer *)theTimer;
-(void)updateReady:(NSTimer *)theTimer;

//Menu and text alert methods
-(void) showPauseMenu;
-(void) showQuitConfirmation;
-(void) showOptions;
-(void) showHelp;
-(void) showHighScores;
-(void) getUserName:(BOOL)uName;
-(void) getUserNameErrorMSG:(BOOL)uName;
-(void) saveAndQuit: (BOOL) save;
-(void) quit;
-(NSString*)stringForHS:(BOOL)strReady;
-(IBAction) ScoreButtonPressed:(id)sender;
-(void) showEndGameAlert:(BOOL)didMakeHighScore;

//Begin-end methods
//-(void) startGame;
-(void) endGame;
-(BOOL) checkForHighScore;

@end
